<template>
    <div>
        <a-modal
            v-model:visible="visible"
            :title="formState.fwjbt+'--统计'"
            width="100%"
            wrapClassName="full-modal"
            :footer="null"
        >
            <div style="height: calc(100vh - 120px);overflow-y: auto;">
                <table border="1" style="border-color: #000;width: 100%;">
                    <tr>
                        <th style="width: 50%;vertical-align: middle;text-align: center;padding: 5px 0;">问卷题目</th>
                        <th style="width: 25%;text-align: center;padding: 5px 0;">选项</th>
                        <th style="width: 25%;text-align: center;padding: 5px 0;">统计</th>
                    </tr>
                    <tr v-for="(item,index) in dataList" :key="index" style="width: 100%;">
                        <td style="text-align: center;" :rowspan="item.tmxxList.length+1" v-if="item.tm">{{ item.tm }}</td>
                        <td style="text-align: center;" v-if="item.tmxx">{{ item.tmxx }}</td>
                        <td style="text-align: center;" v-if="item.count || item.count == 0">{{ item.count }}</td>
                    </tr>
                    
                </table>
            </div>
            
        </a-modal>
    </div>
</template>
<script>
import {
    wjStatqueryWjtmStatCount,
} from './service/index'
export default {
    components:{

    },
    props:{

    },
    data(){
        return{
            visible:false,
            dataList:[],
            formState:{},
        }
    },
    watch:{

    },
    mounted(){
        
    },
    methods:{
        getData(val){
            this.formState = val
            this.dataList = []
            wjStatqueryWjtmStatCount({id:val.id}).then(res=>{
                if(res.code == 200){
                    res.result.forEach(item=>{
                        this.dataList.push(item)
                        this.dataList.push(...item.tmxxList)
                    })
                    // this.dataList = 
                }else{
                    this.dataList = []
                }
            })
        },
    }
}
</script>
<style lang="less" scoped>
.full-modal {
  .ant-modal {
    max-width: 100%;
    top: 0;
    padding-bottom: 0;
    margin: 0;
  }
  .ant-modal-content {
    display: flex;
    flex-direction: column;
    height: calc(100vh);
    // overflow-y: auto;
  }
  .ant-modal-body {
    flex: 1;
  }
}
</style>